package com.zhongfl.crm.enums.boss;


import com.zhongfl.crm.exception.CRMException;
import lombok.Getter;

/**
 * 核销状态枚举
 *
 * @author tiantian
 * @date 2018/5/4
 */
public enum WriteOffStatusEnum {

    NO(0, "待核销"),
    YES(1, "已核销");

    @Getter
    private int value;

    @Getter
    private String desc;

    WriteOffStatusEnum(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static WriteOffStatusEnum valueOf(int value) {
        for (WriteOffStatusEnum templateEnum : WriteOffStatusEnum.values()) {
            if (templateEnum.getValue() == value) {
                return templateEnum;
            }
        }
        throw new CRMException("没有在WriteOffStatusEnum找到枚举值为" + value + "的枚举");
    }
}
